[client]
port={{ mysql_run_port }}
socket={{ mysql_base }}/mysql.sock

[mysqld]
basedir={{ mysql_base }}
datadir={{ mysql_data }}
port={{ mysql_run_port }}
socket={{ mysql_base }}/mysql.sock

user={{ mysql_run_user }}

server_id={{ serverid }}
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
##GTID
gtid_mode=on                 #开启gtid模式
enforce_gtid_consistency=on  #强制GTID一致性
log-slave-updates=on
master_info_repository=TABLE
relay_log_info_repository=TABLE

interactive_timeout=1800
wait_timeout=1800

skip_name_resolve=1
max_connections=1024

expire_logs_days=7
max_binlog_size=500M

##开启binlog日志
binlog-format=Row
log-bin={{ mysql_logs }}/binlog/mysql-bin
relay-log={{mysql_logs}}/relaylog/relay-log
log-error={{ mysql_logs }}/mysqld.log

##开启错误日志，慢日志
slow_query_log=ON
long_query_time=1
log_queries_not_using_indexes=1
slow_query_log_file={{ mysql_logs }}/slow_query.log
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'

log-bin-trust-function-creators=1
explicit_defaults_for_timestamp=true
character-set-server=utf8mb4
init-connect='SET NAMES utf8mb4'
collation-server=utf8mb4_general_ci
skip-external-locking
key_buffer_size=16M
max_allowed_packet=1024M
table_open_cache=64
sort_buffer_size=512K
net_buffer_length=8K
read_buffer_size=256K
read_rnd_buffer_size=512K
myisam_sort_buffer_size=8M

default_authentication_plugin=mysql_native_password
group_concat_max_len=102400

[client]
default-character-set=utf8mb4

[mysqldummp]
max_allowed_packet=1024M

[mysql]
default-character-set=utf8mb4
